package com.space.springcloud.ribbon.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * 类名：com.space.springcloud.ribbon.controller.DcController.
 * 描述：
 * 创建者： ztzn.
 * 创建时间：2018/4/27.
 * 版本：V 1.0
 */


@RestController
public class DcController {


    @Value("${serviceUrl}")
    String SERVICEURL;
    @Autowired
    RestTemplate restTemplate;

    @GetMapping("/consumer")
    public String dc() {

        System.out.println("SERVICEURL=====" + SERVICEURL);
        return restTemplate.getForObject(SERVICEURL, String.class);
    }
}
